#ifndef LIFESYNC_H
#define LIFESYNC_H

#include <QDesktopWidget>
#include <QtGui/QWidget>
#include <QFileDialog>
#include <QMoveEvent>
#include <QSettings>
#include <QSound>
#include <QTimer>

#include "info/info.h"
#include "ui_lifesync.h"
#include "settings/settings.h"
#include "calendar/calendar.h"
#include "contacts/contacts.h"
#include "unlocked/unlocked.h"
#include "checklist/checklist.h"
#include "calculator/calculator.h"
#include "calendar/calendarwindow.h"
#include "quicklaunch/quicklaunch.h"
#include "minilifesync/minilifesync.h"
#include "favoritesedit/favoritesedit.h"

class LifeSync : public QWidget
{
    Q_OBJECT
    
    public:
        ~LifeSync();
        Ui::LifeSync *mainWindow;
        MiniLifeSync *miniWindow;
        LifeSync(QWidget *parent = 0);

    protected:
        //Track when the user moves the main window
        void mousePressEvent(QMouseEvent *mouse);
        void mouseMoveEvent(QMouseEvent *mouse);

    private: 
        //Holds current position of the mouse
        QPoint currentPos;

        //Holds LifeSync window transparency value
        double sliderDoubleValue;

        Info *info;
        Checklist *check;
        Unlocked *unlock;
        Settings *settings;
        Contacts *contacts;
        QuickLaunch *quick;
        Calculator *calculator;
        CalendarWindow *calendarWindow;
        FavoritesEdit *favEdit;

        //Window color check
        int windowColorCheck;

        //Tracks error reports
        QString errorDisplay;

        //LifeSync rewards display
        QString avatarReward;

        //Tracks if user has checked the disable sound checkbox in settings
        bool disableSounds;
        int disableSoundsCheck;

        //Tracks total LifeSync program launches
        int programCounter;

        //Used to ensure LifeSync Mini is moved to the same position of LifeSync
        int x,y;

        //Used to track which button style the user has selected
        QString buttonStyleNumber;

        //Window color and title colors
        QString windowColor;
        QString titleColor;

        //Project LifeSync main settings
        void readSettings();
        void writeSettings();

    private slots: 
        void on_closeLifeSync_Button_clicked();
        void on_contactsDisplay_Button_clicked();
        void on_calendarDisplay_Button_clicked();
        void on_settingsDisplay_Button_clicked();
        void on_checklistDisplay_Button_clicked();
        void on_calculatorDisplay_Button_clicked();
        void on_quickLaunchDisplay_Button_clicked();
        void on_informationDisplay_Button_clicked();
        void on_favoritesDisplay_Button_clicked();

    public slots:
        void rewardsUpdates();
        void lifeSyncSounds();

        void enableLifeSyncMini();
        void enableLifeSyncFull();

        //Enable the main and mini button styles
        void enableButtonStyleOne();
        void enableButtonStyleTwo();
        void enableButtonStyleThree();
        void enableButtonStyleFour();
        void enableButtonStyles();

        void Custom_Avatar_Changed();
        void Avatar_Changed(QListWidgetItem*);

        void allColor_WindowChanges();
        void miniQuickLaunchDisplay();
        void mainColor_WindowChanges();
        void allWindowColor_Functions();
        void colorDefault_WindowChanges();
        void settingsColor_WindowChanges();
        void contactsColor_WindowChanges();
        void calendarColor_WindowChanges();
        void checklistColor_WindowChanges();
        void favoritesColor_WindowChanges();
        void calculatorColor_WindowChanges();
        void informationColor_WindowChanges();
        void colorSet_WindowChanges(QListWidgetItem*);
        void eachWindowColor_Functions(QString windowColor, QString titleColor);

        void setLifeSyncWindowTransparency(int);
};

#endif // LIFESYNC_H
